Skip to content

feat: merge-train/spartan-v5 - #25156

Open
AztecBot wants to merge 10 commits into
v5-nextfrom
merge-train/spartan-v5
Open

feat: merge-train/spartan-v5#25156
AztecBot wants to merge 10 commits into
v5-nextfrom
merge-train/spartan-v5

Conversation

@AztecBot

@AztecBot AztecBot commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

BEGIN_COMMIT_OVERRIDE
fix: include standard-contracts historical artifacts in release image (#25155)
END_COMMIT_OVERRIDE

Gossip tx validation waits on the tx pool serial queue (canAddPendingTx /
addPendingTxs). handleFinalizedBlock occupied that queue for the entire
finalization of an epoch's worth of mined txs (hydrate + deserialize +
archive + delete), stalling validation for 10-40s on mainnet nodes.

- Split finalization into chunk-sized serial-queue items so gossip pool
  operations interleave with finalization.
- Archive raw proof-stripped buffers instead of deserializing and
  re-serializing every tx.
- Add per-stage timing instrumentation to gossiped tx validation, queue
  wait/execution metrics to the tx pool serial queue, and IVC metrics to
  the peer BatchChonkVerifier.
- Scrape and log the new metrics in the spartan TPS benchmarks.
… cursor leak

Finalization now runs as chunk-sized serial-queue items (prepare, archive,
delete, complete) so gossip-driven pool operations interleave instead of
waiting for an entire epoch's worth of mined txs. The archive copies raw
proof-stripped buffers instead of deserializing and re-serializing each tx.

Also fixes a latent deadlock in TxArchive: getHeadIndex/getTailIndex called
.next() once on entriesAsync and abandoned the generator. Inside a write
transaction the committed-state iterator is unbounded, so the abandoned
generator never sent CLOSE_CURSOR, permanently leaking one of the store's
cursor semaphore slots per call and deadlocking the store after 8 archive
transactions.
…hive

- deleteFinalizedTxs re-checks each tx is still mined at or before the
  cutoff before deleting, since other pool operations may interleave
  between the finalization plan being computed and the delete chunk.
- archiveTxBuffers skips txs already archived, so a retried or crashed
  finalization cannot append a duplicate FIFO index entry whose eviction
  would delete the stored value out from under the newer entry.
- handleFinalizedBlock chains concurrent finalizations so their chunked
  queue items never interleave with each other.
PR #25032 added a top-level import of
standard-contracts/artifacts-historical/HandshakeRegistry-5.0.1.json, but
the release image dockerignore only whitelists artifacts/, so every node
started from a v5-line release image crash-loops at ESM link time with
ERR_MODULE_NOT_FOUND. This broke all spartan network deploys from
v5-next since 2026-07-29.
…#25155)

Since #25032, `@aztec/standard-contracts` has a top-level import of
historical artifact JSONs from
`standard-contracts/artifacts-historical/`. The release image
dockerignore ignores everything and then whitelists specific paths, and
it only whitelisted `standard-contracts/artifacts/` — so the historical
artifacts never made it into the image.

- Every node built from a v5-next release image crash-loops on startup
at ESM link time with `ERR_MODULE_NOT_FOUND` for
`HandshakeRegistry-5.0.1.json`.
- This has broken all spartan deploys from this line since 2026-07-29.
- The fix is a single whitelist entry:
`!/yarn-project/standard-contracts/artifacts-historical/`.

Split out from #25148 so the deploy fix can land independently of that
PR's review. Once this merges, #25148 will be rebased and its duplicate
commit will drop out.

@ludamad ludamad left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Auto-approved

@AztecBot
AztecBot enabled auto-merge August 11, 2026 18:16
@AztecBot

Copy link
Copy Markdown
Collaborator Author

🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass.

@AztecBot
AztecBot added this pull request to the merge queue Aug 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants